package com.cipe.cmrs.model.ref;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

@Entity
@Table(name = "linkcategory")
@Cache(usage = CacheConcurrencyStrategy.READ_ONLY)
public class LinkCategory extends BaseRef {

	private static final long serialVersionUID = -6837099300945473277L;
	
    @ManyToMany(cascade = CascadeType.ALL)
    @JoinTable(name = "categorylinks", joinColumns = { @JoinColumn(name = "linkcategoryid") }, inverseJoinColumns = { @JoinColumn(name = "linkid") })
    @OrderBy("displayOrder")
    private List<Link> links;

	public List<Link> getLinks() {
		return links;
	}

	public void setLinks(List<Link> links) {
		this.links = links;
	}

}
